package today.rocky.boot.eureka.fallback;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import today.rocky.boot.eureka.feign.ProFeign;

/**
 * @author Rocky
 * @version 1.0
 * @date 2020/3/3 20:04
 */
@Component
public class ProFeignFallBack implements FallbackFactory<ProFeign> {
    @Override
    public ProFeign create(Throwable throwable) {
        return new ProFeign() {
            @Override
            public String getHello() {
                return "服务挂掉了  不说了";
            }

            @Override
            public String echo(String message) throws Exception {
                return "服务挂掉了  不回显了";
            }
        };
    }
}
